#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
@Project ：Flower_Class
@File    ：Main.py
@IDE     ：PyCharm
@Author  ：Rice_cc
@Date    ：2024/10/16 0:35
"""
import sys

from PyQt5.QtWidgets import QApplication

import windows
import os
import matplotlib.pyplot as plt


# 查看图像数量
def read_flower_data(folder_name):
    folders = os.listdir(folder_name)
    flower_names = []
    flower_nums = []
    for folder in folders:
        folder_path = os.path.join(folder_name, folder)
        images = os.listdir(folder_path)
        images_num = len(images)
        print("{}:{}".format(folder, images_num))
        flower_names.append(folder)
        flower_nums.append(images_num)
    return flower_names, flower_nums


if __name__ == "__main__":
    # x, y = read_flower_data("C:/Users/23987/Downloads/flower_photos/flower_photos")
    app = QApplication(sys.argv)  # pyqt窗口需要在QApplication方法中使用
    x = windows.MainWindow()  # 生成MainWindow类的实例 x
    x.show()  # x调用show方法
    sys.exit(app.exec_())  # 消息结束时，进程结束并返回0，再调用sys.exit(0)退出程序
